package com.flycun;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@EnableEurekaClient
@RestController
public class UserWebApplication {
	
	private static final Logger logger=LoggerFactory.getLogger(UserWebApplication.class);

	public static void main(String[] args) throws Exception {
		SpringApplication.run(UserWebApplication.class, args);
	
	}
	
	@RequestMapping("/user/{id}")
	public String getUser(@PathVariable("id") int id) {
		
		logger.info("getUser:{}",id);
		return "user:"+id;
	}
	
	@RequestMapping("/user/credit/{id}")
	public String getCredit(@PathVariable("id") int id) {
		
		logger.info("getCredit:{}",id);
		return "credit:"+id;
	}
}